package com.oreilly.ez.entity;


import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Transient;
import javax.validation.constraints.NotBlank;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

@Entity
@Table(name = "sys_user")
@Data
@NoArgsConstructor
@ToString
public class SysUser {

    @Id
    @GeneratedValue
    private Integer sid;

    @NotBlank(message = "登录标识不能为空")
    private String pin;
    private String note;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone="GMT+8")
    private Date udate ;



    @Transient
//    @OneToMany(mappedBy = "user")
    private List<Car> carList = new ArrayList<>();


}
